<?php
class Ueditoraudio extends CI_Controller{
	public function __construct(){
		parent::__construct();
		$this->load->library('ComUploads');
		$this->load->library('ComImages');
		$this->up=new ComUploads();
		$this->img=new ComImages();
	}
	//视频上传
	public function upaudio(){
		$setconfig[]=array('exts',array('mp3'));
		$setconfig[]=array('savePath','ueditor/auido');
		$this->up->setconfig($setconfig);
		$files=$_FILES['upfileone'];
		$info=$this->up->upload_one($files);
		//更新键值为0
		$info=array_values($info);
		if(!$info){
			$return['status']=false;
			$return['msg']=$this->up->getError()[0];
		}else{
			$return['status']=true;
			$return['msg']="上传成功";
			$return['imgshow']=trim($info[0]['filename'],'./');
			$return['img']=trim($info[0]['filename'],'./');
		}
		$return=json_encode($return);
		$str = '<script type="text/javascript">parent.postMessage('.$return.', "*")</script>';
		echo $str;exit;
		//echo '<script>window.parent.upfile('.$return.')</script>';
	}
}
?>